﻿using MediatR;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;

namespace S.Weaning.ApI.Application.Command
{
    public class LambWeaningCommand 
    {
        /// <summary>
        /// 羔羊断奶新增
        /// </summary>
        public class AddLambWeaningCommand : IRequest<int>
        {

            /// <summary>
            /// 断奶日期
            /// </summary>
            public DateTime? WeaningDate { get; set; }


            /// <summary>
            /// 单据号
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? DocumentNumber { get; set; }

            /// <summary>
            /// 流水号
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? SerialNumber { get; set; }

            /// <summary>
            /// 备注
            /// </summary>
            [Column(TypeName = "nvarchar(200)")]
            [MaxLength(200)]
            public string? Notes { get; set; }

            public List<Lambweaning>  lambweaning { get; set; }

        }
        public class Lambweaning
        {
            /// <summary>
            /// 电子耳号
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? EITag { get; set; }
            /// <summary>
            /// 可视耳号
            /// </summary>
            public string EarTag { get; set; }
            /// <summary>
            /// 性别
            /// </summary>
            public bool Sex { get; set; }
            // <summary>
            /// 哺乳种母耳号
            /// </summary>
            public string? MammalianNumber { get; set; }

            /// <summary>
            /// 胎次
            /// </summary>
            public int? Parity { get; set; }

            /// <summary>
            /// 断奶栋舍
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TurnOutBuild { get; set; }

            /// <summary>
            /// 断奶栏位
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TurnOutHuts { get; set; }

            /// <summary>
            /// 转入栋舍
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TransferBuilding { get; set; }

            /// <summary>
            /// 转入栏位
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TransferField { get; set; }

            /// <summary>
            /// 断奶重
            /// </summary>
            [Column(TypeName = "decimal(10,2)")]
            public decimal? WeaningWeight { get; set; }

            /// <summary>
            /// 断奶日龄
            /// </summary>
            public int? WeaningDayAge { get; set; }

            /// <summary>
            /// 创建人
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? CreateBy { get; set; }

            /// <summary>
            /// 创建时间
            /// </summary>
            public DateTime? CreateDate { get; set; }
            /// <summary>
            /// 负责人
            /// </summary>
            public int UserId { get; set; }
        }


        /// <summary>
        /// 羔羊断奶信息删除
        /// </summary>
        public class DelLambWeaningCommand : IRequest<bool>
        {
            public DelLambWeaningCommand(string ids)
            {
                this.ids = ids;
            }
            public string ids { get; set; }
        }



        public class UpdLambWeaningCommand : IRequest<bool>
        {
            public int LambEarNumberId { get; set; }

            /// <summary>
            /// 可视耳号
            /// </summary>
            public string EarTag { get; set; }
            /// <summary>
            /// 性别
            /// </summary>
            public bool Sex { get; set; }

            /// <summary>
            /// 哺乳种母耳号
            /// </summary>
            public string? MammalianNumber { get; set; }

            /// <summary>
            /// 胎次
            /// </summary>
            public int? Parity { get; set; }

            /// <summary>
            /// 断奶栋舍
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TurnOutBuild { get; set; }

            /// <summary>
            /// 断奶栏位
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TurnOutHuts { get; set; }

            /// <summary>
            /// 转入栋舍
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TransferBuilding { get; set; }

            /// <summary>
            /// 转入栏位
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? TransferField { get; set; }

            /// <summary>
            /// 断奶重
            /// </summary>
            [Column(TypeName = "decimal(10,2)")]
            public decimal? WeaningWeight { get; set; }

            /// <summary>
            /// 断奶日龄
            /// </summary>
            public int? WeaningDayAge { get; set; }


            /// <summary>
            /// 修改人
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? UpdateBy { get; set; }

            /// <summary>
            /// 修改时间
            /// </summary>
            public DateTime? UpdateDate { get; set; }

            /// <summary>
            /// 断奶日期
            /// </summary>
            public DateTime? WeaningDate { get; set; }


            /// <summary>
            /// 单据号
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? DocumentNumber { get; set; }

            /// <summary>
            /// 流水号
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? SerialNumber { get; set; }

            /// <summary>
            /// 备注
            /// </summary>
            [Column(TypeName = "nvarchar(200)")]
            [MaxLength(200)]
            public string? Notes { get; set; }
            /// <summary>
            /// 负责人
            /// </summary>
            public int UserId { get; set; }
        }

    }
}
